<!DOCTYPE html>
<html>
<head>
    <meta name="layout" content="main"/>
    <g:set var="entityName" value="${message(code: 'contact.label', default: 'Contact')}"/>
    <title>客户详情</title>
</head>

<body class="fixed-navbar fixed-sidebar">
<div class="small-header">
    <div class="hpanel">
        <div class="panel-body">
            <div id="hbreadcrumb" class="pull-right">
                <ol class="hbreadcrumb breadcrumb">
                    <li>Cake Store</li>
                    <li class="active">
                        <span>客户详情</span>
                    </li>
                </ol>
            </div>

            <h2 class="font-light m-b-xs">
                客户详情
            </h2>
        </div>
    </div>
</div>
<div class="content animate-panel">
    <div class="row">
        <g:if test="${flash.message}">
            <div class="message alert alert-info" role="status">${flash.message}
                <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span
                        aria-hidden="true">×</span></button>
            </div>
        </g:if>
        <div class="hpanel hgreen">
            <div class="panel-heading">
                <div class="panel-tools">
                    <g:link class="btn btn-info btn-xs" action="edit" resource="${this.contact}" id="${it?.contact?.id}"><i class="fa fa-edit"></i> 编辑</g:link>
                    <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                </div>
                客户详情
            </div>

            <div class="panel-body form-horizontal">

                <div class="form-group">
                    <label class="col-md-2 control-label">姓名</label>

                    <div class="col-md-3">
                        <p class="form-control-static">${this.contact?.fullName}</p>
                    </div>

                    <label class="col-md-2 control-label">手机号</label>

                    <div class="col-md-3">
                        <p class="form-control-static">${this.contact?.cellphone}</p>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-2 control-label">城市</label>

                    <div class="col-md-3">
                        <p class="form-control-static">${this.contact?.city}</p>
                    </div>

                    <label class="col-md-2 control-label">所属地址</label>

                    <div class="col-md-3">
                        <p class="form-control-static">${this.contact?.address}</p>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-2 control-label">微信号</label>

                    <div class="col-md-3">
                        <p class="form-control-static">${this.contact?.wechatNumber}</p>
                    </div>
                </div>

            </div>
        </div>


        <div class="hpanel hyellow">
            <div class="panel-heading">
                <div class="panel-tools">
                    <!-- <g:link controller="address" action="create" params="[contact: this.contact?.id]" class="btn btn-info btn-xs"><i class="fa fa-plus"></i>新增</g:link> -->
                    <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                </div>
                收货地址
            </div>

            <div class="panel-body no-padding">
                <div class="table-responsive">
                    <table class="table table-striped table-bordered table-hover text-center">
                        <thead>
                        <tr>
                            <g:sortableColumn property="address.city" title="城市"></g:sortableColumn>
                            <g:sortableColumn property="address.address" title="收货地址"></g:sortableColumn>
                            <g:sortableColumn property="address.fullName" title="联系人姓名"></g:sortableColumn>
                            <g:sortableColumn property="address.cellphone" title="联系人电话"></g:sortableColumn>
                            <!-- <g:sortableColumn property="address.zip" title="邮编"></g:sortableColumn> -->
                            <!-- <g:sortableColumn property="address.email" title="邮件"></g:sortableColumn> -->
                            <!-- <g:sortableColumn property="address.active" title="默认地址"></g:sortableColumn> -->
                        </tr>
                        </thead>
                        <tbody>
                        <g:each in="${com.next.Address.findAllByContact(this?.contact)}">
                            <tr>
                                <td>${it?.city}</td>
                                <td>${it?.address}</td>
                                <td>${it?.fullName}</td>
                                <td>${it?.cellphone}</td>
                                <!-- <td>${it?.zip}</td> -->
                                <!-- <td>${it?.email}</td> -->
                                <!-- <td>${it?.active ? '是' : '否'}</td> -->
                            </tr>
                        </g:each>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>

    </div>
</div>
</body>
</html>
